from xadmin.models import Node


def GetMbx(node):
    mbx = []
    if node.node_path == '0':
        mbx.append(node)
    else:
        if ',' in node.node_path:
            for n in node.node_path.split(','):
                node_t = Node.objects.get(id=n)
                mbx.append(node_t)
            mbx.append(node)
        else:
            node_t = Node.objects.get(id=node.node_path)
            mbx.append(node_t)
            mbx.append(node)
    return mbx


